package common.fengkai.filepost.common.interfaces.impl;

import common.fengkai.filepost.bean.mysqlBean.EmpUser;
import common.fengkai.filepost.bean.mysqlBean.RequestLogEntity;
import common.fengkai.filepost.common.interfaces.Convert;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * @author Fengkai
 * @creat 2022/11/23
 */
public class RequestLogConvertImpl implements Convert <EmpUser>{

    @Override
    public RequestLogEntity convert (EmpUser empUser) {
        RequestLogEntity requestLogEntity = new RequestLogEntity();
        requestLogEntity.setRequestTime(new Date());
        requestLogEntity.setUserId(String.valueOf(empUser.getId()));
        return requestLogEntity;
    }
}
